package com.itheima.thread.线程创建.demo2;

//线程任务类
public class MyRunnable implements Runnable {
    @Override
    public void run() {
        //线程启动后执行的方法
        for (int i = 0; i < 100; i++) {
            //Thread.currentThread() 获取当前正在运行的线程对象
            System.out.println(Thread.currentThread().getName() + "线程开启了" + i);
        }
    }
}
